package com.example.design.principle.liskov_substitution

class Use {
    fun doSomething(a: 里氏替换) {
        a.doSomething()
    }

    fun doSomething2(a: 里氏替换) {
        a.doSomething2()
    }

    fun main() {
        //effect 1 多态
        doSomething(继承())
        doSomething(继承2())
        doSomething2(继承2())
        //effect 2 使用父类方法
        val jc = 继承()
        jc.doAnything("cz")

    }
}